<%-- 
    Document   : deleteEmployee
    Created on : May 5, 2013, 11:40:58 PM
    Author     : Byung Park
--%>

<%@page import="java.sql.ResultSet"%>
<%@page import="db.UserDAO"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="db.DB"%>
<%
    String userId = request.getParameter("userId");
    String email = request.getParameter("email");
    String lastName = request.getParameter("lastName");
    String firstName = request.getParameter("firstName");
    String address = request.getParameter("address");
    String zipCode = request.getParameter("zipCode");
    String city = request.getParameter("city");
    String state =request.getParameter("state");
    String rating =request.getParameter("rating");
    String level =request.getParameter("level");
    try {
        DB data = new DB();
        Connection conn = data.getConnection();
        Statement st = null;
        st = conn.createStatement();
        String query = "INSERT INTO Users (Email,LastName,FirstName,Address,ZipCode,City,State,Rating,Level,Authority) VALUES ('" + email + "','" + lastName + "','" + firstName + "','" + address +"','" + zipCode +"','" + city +"','" + state +"','" + rating + "','"  + level + "','0');";
        out.println(query);
        st.execute(query);
        response.sendRedirect("customerList.jsp?userId="+userId);

    } catch (Exception e) {
    };
%>

